package cn.appsys.controller.backend;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/manager")
public class BackendLoginController {

	private Logger log = Logger.getLogger(BackendLoginController.class);
	
	@RequestMapping("/login")
	public String login() {
		return "backendlogin";
	}
	
	@RequestMapping("/dologin")
	public String dologin(@RequestParam String userCode
						,@RequestParam String userPassword) {
		log.debug("===================dologin: userCode: "+userCode+ "\t userPassword: "+userPassword );
		//调用service的方法,验证用户名密码
		//验证成功,将用户信息存入session
		//跳转到main
		//验证失败跳转登陆页面
		//return "backend/main";
		return "redirect:/manager/main";
	}
	
	@RequestMapping("/main")  //匹配url中 的请求
	public String main() {
		return "backend/main";  //Webinfo 下面的这个jsp页面
	}
	
	
	
}
